import request from '@/utils/request'
import qs from 'qs'

//获取表格数据
export function getTableList(pageNumber, pageSize) {
  return request({
    url: '/merchant/store/find_by_user_id',
    method: 'get',
    params: {
      pageNumber,
      pageSize,
    }
  })
}

// 登录账号是商户还是店长
export function findUserType() {
  return request({
    url: '/merchant/store/find_user_type',
    method: 'get',
  })
}



// 添加门店
export function addStore(form) {
  return request({
    url: '/merchant/store/add',
    method: 'post',
    data: qs.stringify({
      name: form.name,
      foodTypeId: form.foodTypeId,
      address: form.address,
    }, {indices: false})
  })
}

// 修改门店
export function editStore(form) {
  return request({
    url: '/merchant/store/update',
    method: 'post',
    data: qs.stringify({
      id: form.id,
      name: form.name,
      foodTypeId: form.foodTypeId,
      address: form.address,
    }, {indices: false})
  })
}




